<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Wallet extends Model
{
    //获取钱包数据
    public function get_wallet_data($user_id)
    {
    	$data = $this->where('user_id',$user_id)->first();
    	$data->map(function($item,$key){
    		$item['useable_money'] = $item->money;
    		return $item;
    	});
    	return $data;
    }
}
